package blog.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import blog.entity.Category;
import blog.service.CategoryService;

@Controller @RequestMapping("/category")
public class CategoryController {
	
	@Resource
	private  CategoryService categoryService;
	
	@RequestMapping ("/listsub") @ResponseBody  //这里要返回JSON格式数据必须写注解@ResponseBody
	public List<Category> listsub(Integer parentCateId){	
		return categoryService.listSub(parentCateId);
	}

}
